﻿@namespace BlazorComponent
@typeparam TItem
@typeparam TItemValue
@typeparam TValue
@inherits ComponentPartBase<ISelectList<TItem, TItemValue, TValue>>

<BListItem @onmousedown:preventDefault
           @key="Item"
           Disabled="@IsDisabled"
           OnClick="@HandleOnClick"
           @attributes="@GetAttributes(typeof(BListItem), data: (Item,Value))">
    @if (ItemContent == null)
    {
        if (Action && !HideSelected && Items.Count > 0)
        {
            @RenderPart(typeof(BSelectListAction<,,>), Item, Value)
        }
        @RenderPart(typeof(BSelectListTileContent<,,>), Item, Value)
    }
    else
    {
        var props = new SelectListItemProps<TItem>(Item, HandleOnClick);
        @ItemContent(props)
    }
</BListItem>
